package com.mskj.p3.service.imp;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mskj.p3.dao.BlogDao;
import com.mskj.p3.model.Blog;
import com.mskj.p3.model.BlogSet;
import com.mskj.p3.model.Hobby;
import com.mskj.p3.model.PageBean;
import com.mskj.p3.model.User;
import com.mskj.p3.service.BlogService;

@Service
public class BlogServiceImp implements BlogService {
	
	@Autowired
	private BlogDao bd;
	
	@Override
	public boolean postBlog(User user, Blog b,Hobby h) {
		b.setHid(h.getHid());
		b.setUid(user.getUid());
		return bd.postBlog(b);
	}

	@Override
	public boolean deleteBlog(User user, Blog b) {
		return bd.deleteBlog(b, user);
	}

	@Override
	public List<BlogSet> queryBlogSet(User user,PageBean pb) {
		return bd.queryBlogSet(user,pb);
	}

	@Override
	public List<BlogSet> queryMyBlogSet(User user, PageBean pb) {
		return bd.queryMyBlogSet(user,pb);
	}

}
